#include "ros/ros.h"
#include "std_msgs/String.h"
#include "sstream"

void dohouse(const std_msgs::String::Ptr &msg)
{
    ROS_INFO("DO YOU HAVE HOUSE?");
    ROS_INFO("翠花收到的信息 %s ", msg->data.c_str());
}

int main(int argc, char** argv)
{
    setlocale(LC_ALL, "");
    ros::init(argc, argv, "cuihua");

    ros::NodeHandle nh;

    ros::Subscriber sub=nh.subscribe("fang", 10, dohouse);

    ros::spin();
    ROS_INFO("spin 后的数据");


    return 0;
}